package gcontent.config.persistents.node;

import gcontent.config.error.ConfigEx;

import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class MethodNode {

	private String id;
	private String function;
	
	public String getId()
	{
		return this.id;
	}
	
	public String getFunction()
	{		
		return this.function;
	}

	public MethodNode(Node node) throws ConfigEx
	{		
		NamedNodeMap node_map;
		
		node_map = node.getAttributes();
		if(node_map == null)
			throw new ConfigEx("MethodNode : not id attribute defined");
		
		if(node_map.getNamedItem("id") == null)
			throw new ConfigEx("MethodNode : not id attribute defined");

		this.id = node_map.getNamedItem("id").getNodeValue();
		this.function = node_map.getNamedItem("function").getNodeValue();		
	}
}
